<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content=
    "application/xhtml+xml; charset=iso-8859-1" />
    <title>
      6.52.&nbsp;Kmod-12
    </title>
    <link rel="stylesheet" href="../stylesheets/lfs.css" type="text/css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=
    "text/css" media="print" />
  </head>
  <body class="lfs" id="lfs-7.3">
    <div class="navheader">
      <h4>
        Linux From Scratch - Version 7.3
      </h4>
      <h3>
        Chapter&nbsp;6.&nbsp;Installing Basic System Software
      </h3>
      <ul>
        <li class="prev">
          <a accesskey="p" href="kbd.html" title="Kbd-1.15.5">Prev</a>
          <p>
            Kbd-1.15.5
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="libpipeline.html" title=
          "Libpipeline-1.2.2">Next</a>
          <p>
            Libpipeline-1.2.2
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="chapter06.html" title=
          "Chapter&nbsp;6.&nbsp;Installing Basic System Software">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Linux From Scratch - Version 7.3">Home</a>
        </li>
      </ul>
    </div>
    <div class="wrap" lang="en" xml:lang="en">
      <h1 class="sect1">
        <a id="ch-system-kmod" name="ch-system-kmod"></a>6.52. Kmod-12
      </h1>
      <div class="package" lang="en" xml:lang="en">
        <p>
          The Kmod package contains libraries and utilities for loading
          kernel modules
        </p>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong class="segtitle">Approximate build time:</strong>
              <span class="segbody">0.1 SBU</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Required disk space:</strong>
              <span class="segbody">30 MB</span>
            </div>
          </div>
        </div>
      </div>
      <div class="installation" lang="en" xml:lang="en">
        <h2 class="sect2">
          6.52.1. Installation of Kmod
        </h2>
        <p>
          Prepare Kmod for compilation:
        </p>
        <pre class="userinput">
<kbd class="command">./configure --prefix=/usr       \
            --bindir=/bin       \
            --libdir=/lib       \
            --sysconfdir=/etc   \
            --disable-manpages  \
            --with-xz           \
            --with-zlib</kbd>
</pre>
        <div class="variablelist">
          <p class="title">
            <b>The meaning of the configure options:</b>
          </p>
          <dl>
            <dt>
              <span class="term"><em class=
              "parameter"><code>--with-*</code></em></span>
            </dt>
            <dd>
              <p>
                These options enable Kmod to handle compressed kernel
                modules.
              </p>
            </dd>
            <dt>
              <span class="term"><em class=
              "parameter"><code>--disable-manpages</code></em></span>
            </dt>
            <dd>
              <p>
                This option prevents the man pages from being built, as they
                rely on libxslt, which isn't available in the chroot
                environment.
              </p>
            </dd>
          </dl>
        </div>
        <p>
          Compile the package:
        </p>
        <pre class="userinput">
<kbd class="command">make</kbd>
</pre>
        <p>
          To test the results, issue:
        </p>
        <pre class="userinput">
<kbd class="command">make check</kbd>
</pre>
        <p>
          Install the package, and create symlinks for compatibility with
          Module-Init-Tools, the package that previously handled Linux kernel
          modules:
        </p>
        <pre class="userinput">
<kbd class="command">make pkgconfigdir=/usr/lib/pkgconfig install

for target in depmod insmod modinfo modprobe rmmod; do
  ln -sv ../bin/kmod /sbin/$target
done

ln -sv kmod /bin/lsmod</kbd>
</pre>
      </div>
      <div class="content" lang="en" xml:lang="en">
        <h2 class="sect2">
          <a id="contents-kmod" name="contents-kmod"></a>6.52.2. Contents of
          Kmod
        </h2>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong class="segtitle">Installed programs:</strong>
              <span class="segbody">depmod (link to kmod), insmod (link to
              kmod), kmod, kmod-nolib, lsmod (link to kmod), modinfo (link to
              kmod), modprobe (link to kmod), and rmmod (link to kmod)</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed libraries:</strong>
              <span class="segbody">/lib/kmod.so</span>
            </div>
          </div>
        </div>
        <div class="variablelist">
          <h3>
            Short Descriptions
          </h3>
          <table border="0">
            <col align="left" valign="top" />
            <tbody>
              <tr>
                <td>
                  <p>
                    <a id="depmod" name="depmod"></a><span class=
                    "term"><span class=
                    "command"><strong>depmod</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Creates a dependency file based on the symbols it finds
                    in the existing set of modules; this dependency file is
                    used by <span class=
                    "command"><strong>modprobe</strong></span> to
                    automatically load the required modules
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="insmod" name="insmod"></a><span class=
                    "term"><span class=
                    "command"><strong>insmod</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Installs a loadable module in the running kernel
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="kmod" name="kmod"></a><span class=
                    "term"><span class=
                    "command"><strong>kmod</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Loads and unloads kernel modules
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="libkmod" name="libkmod"></a><span class=
                    "term"><code class="filename">libkmod</code></span>
                  </p>
                </td>
                <td>
                  <p>
                    This library is used by other programs to load and unload
                    kernel modules
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="lsmod" name="lsmod"></a><span class=
                    "term"><span class=
                    "command"><strong>lsmod</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Lists currently loaded modules
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="modinfo" name="modinfo"></a><span class=
                    "term"><span class=
                    "command"><strong>modinfo</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Examines an object file associated with a kernel module
                    and displays any information that it can glean
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="modprobe" name="modprobe"></a><span class=
                    "term"><span class=
                    "command"><strong>modprobe</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Uses a dependency file, created by <span class=
                    "command"><strong>depmod</strong></span>, to
                    automatically load relevant modules
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="rmmod" name="rmmod"></a><span class=
                    "term"><span class=
                    "command"><strong>rmmod</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Unloads modules from the running kernel
                  </p>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    </div>
    <div class="navfooter">
      <ul>
        <li class="prev">
          <a accesskey="p" href="kbd.html" title="Kbd-1.15.5">Prev</a>
          <p>
            Kbd-1.15.5
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="libpipeline.html" title=
          "Libpipeline-1.2.2">Next</a>
          <p>
            Libpipeline-1.2.2
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="chapter06.html" title=
          "Chapter&nbsp;6.&nbsp;Installing Basic System Software">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Linux From Scratch - Version 7.3">Home</a>
        </li>
      </ul>
    </div>
  </body>
</html>
